import request from '@/utils/request.ts'
import {
    DoctorInfoResponseData,
    HospitalDepartmentResponseData,
    HospitalDetailResponseData,
    HospitalSchedulingResponseData,
    SchedulingDoctorResponseData,
    VisitorResponseData
} from "@/api/hospital/type.ts";
enum API{
    // 医院的详细信息接口地址
    hospital_detail='/hosp/hospital/',
    // 医院的科室接口地址
    hospital_department='/hosp/hospital/department/',
    // 预约挂号排班接口地址
    hospital_scheduling='/hosp/hospital/auth/getBookingScheduleRule/',
    // 具体某天的挂号排班数据地址
    hospitai_specific_schedule='/hosp/hospital/auth/findScheduleList/',
    // 就诊人列表地址
    visitor_list='/user/patient/auth/findAll',
    // 获取挂号医生的地址
    doctor_info='/hosp/hospital/getSchedule/'
}

// 获取医院的详细信息
export const reqHospitalDetail=(hoscode:string)=>request.get<any,HospitalDetailResponseData>(API.hospital_detail+`${hoscode}`)

//获取医院的科室信息
export const reqHospitalDepartment=(hoscode:string)=>request.get<any,HospitalDepartmentResponseData>(API.hospital_department+`${hoscode}`)

//获取医院预约排班数据
export const reqHospitalScheduling=(page:number,limit:number,hoscode:string,depcode:string)=>request.get<any,HospitalSchedulingResponseData>(API.hospital_scheduling+`${page}/${limit}/${hoscode}/${depcode}`)

//获取具体某天的预约排班数据
export const reqHospitalSpecific=(hoscode:string,depcode:string,workDate:string)=>request.get<any,SchedulingDoctorResponseData>(API.hospitai_specific_schedule+`${hoscode}/${depcode}/${workDate}`)

//获取就诊人列表数据
export const reqVisitorList=()=>request.get<any,VisitorResponseData>(API.visitor_list)

//获取挂号医生的数据
export const reqDoctorInfo=(scheduleId:string)=>request.get<any,DoctorInfoResponseData>(API.doctor_info+`${scheduleId}`)